home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 16
/
Aminet 16 (1996)(GTI - Schatztruhe)[!][Dec 1996].iso
/
Aminet
/
comm
/
term
/
term_source.lha
/
Extras
/
Source
/
gtlayout-source.lha
/
LTP_DrawPicker.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-03-18
|
879b
|
43 lines
/*
** GadTools layout toolkit
**
** Copyright © 1993-1996 by Olaf `Olsen' Barthel
** Freely distributable.
**
** :ts=4
*/
#ifndef _GTLAYOUT_GLOBAL_H
#include "gtlayout_global.h"
#endif
VOID
LTP_DrawPicker(struct RastPort *RPort,BOOL UpDirection,LONG Left,LONG Top,LONG Width,LONG Height)
{
LONG i,Len,ArrowHeight,ArrowWidth,LineHeight,Start,Pos;
LineHeight = (Height + 15) / 16;
ArrowHeight = Height - (Height + 7) / 8;
ArrowWidth = Width;
for(i = 0 ; i < ArrowHeight ; i++)
{
Len = ((ArrowWidth * (i + 1)) / ArrowHeight) & ~1;
if(Len < ArrowWidth)
Len++;
Start = Left + (ArrowWidth - Len) / 2;
if(UpDirection)
Pos = Top + i;
else
Pos = Top + ArrowHeight - 1 - i;
LTP_DrawLine(RPort,Start,Pos,Start + Len - 1,Pos);
}
for(i = 0 ; i < LineHeight ; i++)
LTP_DrawLine(RPort,Left,Top + Height - 1 - i,Left + Width - 1,Top + Height - 1 - i);
}